﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ThunderLaser : MonoBehaviour {
    public BeamRay ray;
    public GameObject explodeEffectPrefab;
    public float explodeIntervalTime;
    public Timer fireTimer;


    private void Start()
    {
        fireTimer = new Timer(explodeIntervalTime);
    }

    private void Update()
    {
        if(ray.isHit)
        {
            if (fireTimer.Tick(Time.deltaTime))
            {
                Instantiate(explodeEffectPrefab, ray.endPos.position, Quaternion.identity);
            }
        }
        
    }




}
